#ifndef MANAGE_H
#define MANAGE_H
#include<iostream>
#include<vector>
#include<iomanip>

#include"book.h"
#include"user.h"
#include"purchaseRecord.h"
using namespace std;
/*
管理类分为三个，各自管理自己的容器，使得容器的操作更加的安全
*/
class ManageBook
{
public:
    static vector<book> bookList;
    
    int addBook(book &books)
    {
        bookList.push_back(books);
        return 0;
    }
    int removeBook(const string &bookname);
    int alterBookInfor(const string &bookname);
    int showBookInfor();
    vector<book>::iterator findBook(const string&name);

};//class ManageBook

class ManageUser
{
public:
    static vector<user> userList;
    int adduser(user &u)
    {
        userList.push_back(u);
        return 0;
    }
    int removeuser(user &u);
    int alterUserInfor(user &u);
    int showuserInfor();
    int showuserInfor(user &u)
    {
        cout<<left<<setw(11)<<"账号"<<left<<setw(11)<<" 姓名"
            <<left<<setw(15)<<" 电话"<<left<<setw(10)
            <<" 寄送地址"<<left<<setw(10)<<"账户余额"<<endl;
        cout<<u<<endl;
        return 0;
    }
    int findMaxID();
    vector<user>::iterator findUser(int ID);

};//class ManageUser

class ManagePurchaseR
{
public:
    static vector<purchaseRecord> purchaseRecordList;
    int addPurchaseRecord(purchaseRecord &p)
    {
        purchaseRecordList.push_back(p);
        return 0;
    }
    int removePurchaseRecord(purchaseRecord &p);
    int alterPurchaseRecordInfor(purchaseRecord &p);
    int showPurchaseRecordInfor();
    int showPurchaseRecordInfor(user &u);
};//class ManagePurchaseR



#endif